package six.event.enums;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author jiangjinjian
 * @date 2024/5/9 9:58
 * @description 爻
 */
@Getter
@AllArgsConstructor
public enum YaoEnum {

    YangYao("——", "1", false),

    DynamicYangYao("——*", "-1", true),

    YinYao("--", "0", false),

    DynamicYinYao("--*", "-0", true);

    private final String graph;

    private final String numberStr;

    private final boolean isDynamic;

    public static YaoEnum valueAsEnum(String numberStr) {
        return Arrays.stream(values())
                .filter(o -> StrUtil.equals(o.getNumberStr(), numberStr))
                .findFirst().orElse(null);
    }
}
